home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / AIAT / Examples / Sources / DemoIndex.h < prev    next >
Encoding:
Text File  |  1998-04-16  |  1.4 KB  |  58 lines  |  [TEXT/CWIE]

  1. /// DemoIndex.h
  2. //    Copyright:    © 1994 - 1998 by Apple Computer, Inc., all rights reserved.
  3.  
  4.  
  5. #pragma once
  6. #include <Types.h>
  7.  
  8. /// choose a storage implementation
  9. #ifndef DEMOSTORAGE
  10. //#pragma import on
  11. #include "HFSStorage.h"
  12. #define DEMOSTORAGE(FILENAME)        MakeHFSStorage(0,0,FILENAME)
  13. //#pragma import off
  14. #endif
  15.  
  16. /// choose a corpus implementation
  17. //#pragma import on
  18. #include "HFSTextFolderCorpus.h"
  19. #define DEMOCORPUS(ROOTFOLDERNAME)    HFSTextFolderCorpus(ROOTFOLDERNAME)
  20.  
  21. /// choose an analysis implementation
  22. #include "SimpleAnalysis.h"
  23. #define DEMOANALYSIS()                SimpleAnalysis()
  24. //#pragma import off
  25. /// choose an index implementation -- inverted, vector or both
  26. #define DEMOINDEXISINVERTED
  27. #define DEMOINDEXISVECTOR
  28.  
  29. #ifdef DEMOINDEXISINVERTED
  30.     #ifdef DEMOINDEXISVECTOR
  31.         // InVecIndex: inverted and vector
  32.         #define DEMOINDEXCLASS                InVecIndex
  33.         #include                            "InVecIndex.h"
  34.         #define DEMOINDEXFILENAME            "\pinvec.index"
  35.     #else
  36.         // InvertedIndex
  37.         #define DEMOINDEXCLASS                InvertedIndex
  38.         #include                            "InvertedIndex.h"
  39.         #define DEMOINDEXFILENAME            "\pinverted.index"
  40.     #endif
  41. #else
  42.     #ifdef DEMOINDEXISVECTOR
  43.         // VectorIndex
  44.         #define DEMOINDEXCLASS                VectorIndex
  45.         #include                            "VectorIndex.h"
  46.         #define DEMOINDEXFILENAME            "\pvector.index"
  47.     #endif
  48. #endif
  49.  
  50. /// define index subclass
  51.  
  52. class DemoIndex : public DEMOINDEXCLASS {
  53. public:
  54.         DemoIndex(IAStorage* storage, StringPtr rootFolder = NULL);
  55.     void        AddDoc(IADoc* doc);
  56.     void        DeleteDoc(const IADoc* doc);
  57. };
  58.